<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="java.util.*"
	import="com.sellerSystem.vo.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="js/jquery-1.12.0.min.js" type=text/javascript></script>
<style type="text/css">
#p {
	width: 100px;
	height: 100px
}
#welcome{
text-align: right;
}
#a {
	border-color: #FFF;
}
#table{
	text-align: center;
	width: 80%;
	font-size: 25px;
}
#index {
	text-align: right;
}
</style>
<title>欢迎登录！</title>
</head>
<body onResize="Resize()"  >
	<p id="welcome"><i>欢迎<b>${seller.sellerName}</b>来到您的个人商铺！</i></p>
	<p id="index"><a href="loginSuc.jsp">首页</a>&nbsp;&nbsp;<a href="index.html">退出系统</a>&nbsp;</p>
	<p><h2>以下是您的店铺商品：</h2></p>

	<form action="loginSuc" method="post">
		
	</form>
	
<table id="table"></table>
	<table>
	<tr><td>添加新商品</td><td></td><td><a href="addCommodity.jsp" id="a"> <img id="p" src="images/111.jpg"></a></td></tr>
		<!-- <a href="addCommodity.jsp" id="a"> <img id="p" src="images/111.jpg"></a> -->
	</table>
	
</body>
<script>
	//进入个人店铺页面显示所有个人商品
	$(document).ready(function(){
		$.ajax("loginSuc",
				{type : "POST",
					dataType : 'text',
					success : function(data) {
						//alert(data);
						//把data类型的data转换为json对象
						 var jsonObj = eval("(" + data + ")");
						$("#table").html(
										"<tr><th>商品序号</th><th>商品名称</th><th>商品图片</th><th>详情</th></tr>")
						$.each(jsonObj, function(i, item) {
							
							//alert(item.sellerId + ","  + item.sellerName);
							$("#table").append(
									
											"<tr><td>"
											+ item.commodityId
											+ "</td><td>"
											+ item.commodityName
											+ "</td><td>"
											+  "<img src="+item.commodityPic+">"
											+ "</td><td>"
											+ "<a href= 'commodity.jsp?data="+item.commodityId+"'><input type=button value='点击查看详情'></a>"
										
											+ "</td></tr>"

							)
						}); 

					}
				});
	});
		
	
</script>
<script>
	language = "JavaScript"
	type = "text/javascript" > $(function() {
		var winWidth, winHeight;
		Resize = function() {
			winWidth = $(window).width(), winHeight = $(window).height();
		}
	});
</script>

</html>